package main.java.com.extract;


/**
 * @description: 租赁类
 * 第二步重构后的主体代码：
 * @author: cong zhi
 * @createDate: 2022/6/16 7:55
 * @updateUser: cong zhi
 * @updateDate: 2022/6/16 7:55
 * @updateRemark: 修改内容
 * @version: v1.0
 */
public class Rental {
    private Movie movie;
    private int daysRented;

    public Rental(Movie movie, int daysRented) {
        this.movie = movie;
        this.daysRented = daysRented;
    }

    public Movie getMovie() {
        return movie;
    }

    public int getDaysRented() {
        return daysRented;
    }

    public double getAmount() {
        return movie.getAmount(getDaysRented());
    }

    /**
     * 处理了下获取积分的代码
     * @return
     */
    public int getFrequentRetenterPoints() {
        return movie.getFrequentRetenterPoints(getDaysRented());
    }

}
